package com.alpha.processor.creators.connector_file;

import com.alpha.processor.creators.info_model.ConnectorInterfaceInfoModel;
import com.alpha.processor.creators.info_model.ProcessorInfoModel;
import com.alpha.processor.creators.interface_file.ProviderInterfaceCreateModel;
import com.alpha.processor.creators.interface_file.ProviderInterfaceFileCreator;
import com.alpha.processor.processor.tools.ProcessorTool;
import com.alpha.processor.creators.base.CreateModel;
import com.alpha.processor.creators.info_model.ViewInfoModel;

import javax.lang.model.element.TypeElement;
import javax.lang.model.util.Elements;

public class ConnecteCreateModel extends CreateModel {

    public static final String ConnectorFileEndName = "_Connector";

    public static final String InitMethodName = "init";
    public static final String DisposeMethodName = "dispose";
    public static final String GetRootViewMethodName = "getRootView";
    public static final String GetClickListenerMethodName = "getClickListener";

    public static final String BindViewsMethodName = "bindViews";
    public static final String BindProcessorMethodName = "bindProcessor";
    public static final String BindEventsMethodName = "bindEvents";

    public static final String OnClickMethod = "onClick";

    private final ViewInfoModel viewInfoModel = new ViewInfoModel();

    private final ProcessorInfoModel processorInfoModel = new ProcessorInfoModel();

    private ProviderInterfaceCreateModel providerCreateModel;

    private ConnectorInterfaceInfoModel connectorInfoModel;

    public ConnecteCreateModel(ProcessorTool logger, Elements elementUtils, TypeElement classElement) {
        super(logger, elementUtils, classElement);
    }

    public void updateProviderCreateModel(ProviderInterfaceFileCreator fileCreator){
        if (fileCreator == null){
            return;
        }
        this.providerCreateModel = fileCreator.getCreateModel();
    }

    public void updateConnectorInterfaceInfoModel(ConnectorInterfaceInfoModel connectorInfoModel){
        this.connectorInfoModel = connectorInfoModel;
    }

    @Override
    public String getGenarateFileName() {
        return getClassName() + ConnectorFileEndName;
    }

    public ViewInfoModel getViewInfoModel() {
        return viewInfoModel;
    }

    public ProcessorInfoModel getProcessorInfoModel() {
        return processorInfoModel;
    }

    public ProviderInterfaceCreateModel getProviderCreateModel() {
        return providerCreateModel;
    }

    public ConnectorInterfaceInfoModel getConnectorInfoModel() {
        return connectorInfoModel;
    }
}
